
*******************************************************************************************
*******************************************************************************************
******************** Reclassification Risk in the Small Group Health Insurance Market
******************* by Sebastian Fleitas, Gautam Gowrisankaran and Anthony Lo Sasso 
*******************************************************************************************
*******************************************************************************************
*******************************************************************************************
******************** Figure A2 
*******************************************************************************************
*******************************************************************************************
*******************************************************************************************

  
**** MAPS FOR STATES IN SAMPLE

/*
ssc install maptile
ssc install spmap 
maptile_install using "http://files.michaelstepner.com/geo_state.zip"
*/

cd "/Users/sebastianfleitas/Dropbox/MULTICHOICE_PROJECT/PREMIUMS_AND_HEALTHSHOCKS/Tables_RESTAT/Do_files_Analysis/MAPS"

clear all

graph set window fontface "Times New Roman" 
*graph set window fontface "Times New Roman"
*graph set window fontfacemono "Times New Roman"
*graph set window fontfacesans "Times New Roman"
*graph set window fontfaceserif "Times New Roman"
*graph set window fontfacesymbol "Times New Roman"


insheet using data_for_maps.csv, comma

rename state state_name
g state=1 if state_name=="alabama"
replace state=2 if state_name=="alaska"
replace state=4 if state_name=="arizona"
replace state=5 if state_name=="arkansas"
replace state=6 if state_name=="california"
replace state=8 if state_name=="colorado"
replace state=9 if state_name=="connecticut"
replace state=10 if state_name=="delaware"
replace state=11 if state_name=="dc" // DC is not in the dataset
replace state=12 if state_name=="florida"
replace state=13 if state_name=="georgia"
replace state=15 if state_name=="hawaii"
replace state=16 if state_name=="idaho"
replace state=17 if state_name=="illinois"
replace state=18 if state_name=="indiana"
replace state=19 if state_name=="iowa"
replace state=20 if state_name=="kansas"
replace state=21 if state_name=="kentucky"
replace state=22 if state_name=="louisiana"
replace state=23 if state_name=="maine"
replace state=24 if state_name=="maryland"
replace state=25 if state_name=="massachusetts"
replace state=26 if state_name=="michigan"
replace state=27 if state_name=="minnesota"
replace state=28 if state_name=="mississippi"
replace state=29 if state_name=="missouri"
replace state=30 if state_name=="montana"
replace state=31 if state_name=="nebraska"
replace state=32 if state_name=="nevada"
replace state=33 if state_name=="new hampshire"
replace state=34 if state_name=="new jersey"
replace state=35 if state_name=="new mexico"
replace state=36 if state_name=="new york"
replace state=37 if state_name=="north carolina"
replace state=38 if state_name=="north dakota"
replace state=39 if state_name=="ohio"
replace state=40 if state_name=="oklahoma"
replace state=41 if state_name=="oregon"
replace state=42 if state_name=="pennsylvania"
replace state=44 if state_name=="rhode island"
replace state=45 if state_name=="south carolina"
replace state=46 if state_name=="south dakota"
replace state=47 if state_name=="tennessee"
replace state=48 if state_name=="texas"
replace state=49 if state_name=="utah"
replace state=50 if state_name=="vermont"
replace state=51 if state_name=="virginia"
replace state=53 if state_name=="washington"
replace state=54 if state_name=="west virginia"
replace state=55 if state_name=="wisconsin"
replace state=56 if state_name=="wyoming"

rename state statefips
rename state_name statename 

replace treatment=0 if treatment==.

maptile treatment, geo(state) geoid(statefips) spopt(legstyle(2))  fcolor(Greys)  ///
	twopt(legend(label(3 "In Sample") label(2 "Not in sample")) graphregion(lcolor(black))) savegraph(statesmap_sample_Seba.png)  replace  



